
import $axios from '../utils/axios'
import URL from './url'

// 购物车列表
export const cartList = () => {
  return $axios({
    url: URL.CART.CART_LIST,
    method: 'get'
  })
}

// 添加商品到购物车
export const addToCart = data => {
  return $axios({
    url: URL.CART.ADD_CART,
    method: 'post',
    data
  })
}

// 删除
export const removeGoods = cartItemId => {
  return $axios({
    url: URL.CART.REMOVE_GOODS + `/${cartItemId}`,
    method: 'get'
  })
}